package com.biscuit.page.basicservice.api;

import com.biscuit.common.base.BaseResponse;
import com.biscuit.common.base.BaseResponseVoid;
import com.biscuit.common.annotation.RequestWhitelist;
import com.biscuit.page.basicservice.api.model.request.authorization.AuthorizationAReq;
import com.biscuit.page.basicservice.api.model.request.authorization.AuthorizationGetVerifyCodeAReq;
import com.biscuit.page.basicservice.api.model.response.authorization.AuthorizationAResp;
import com.biscuit.page.basicservice.api.model.response.authorization.AuthorizationEncryptAResp;
import com.biscuit.page.basicservice.api.model.response.user.UserInfoAResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author mazihao
 * @createTime 2024/3/22 17:19
 */
@Api(tags = "授权相关接口")
@RequestMapping("/authorization")
public interface IAuthorizationRemote {

    @RequestWhitelist
    @ApiOperation(value = "用户登录认证")
    @PostMapping("/login")
    BaseResponse<AuthorizationAResp> authentication(@RequestBody AuthorizationAReq req);

    @RequestWhitelist
    @ApiOperation(value = "获取验证码")
    @PostMapping("/getVerifyCode")
    BaseResponse<BaseResponseVoid> getVerifyCode(@RequestBody AuthorizationGetVerifyCodeAReq req);

    @RequestWhitelist
    @ApiOperation(value = "MD5加密文本")
    @GetMapping("/encrypt/md5/{text}")
    BaseResponse<AuthorizationEncryptAResp> encryptMd5(@PathVariable("text") String text);

    @RequestWhitelist
    @ApiOperation(value = "非对称私钥加密文本")
    @GetMapping("/encrypt/unsymmetrical/{text}")
    BaseResponse<AuthorizationEncryptAResp> encryptUnsymmetrical(@PathVariable("text") String text);

    @ApiOperation(value = "退出登录")
    @PostMapping("/logout")
    BaseResponse<BaseResponseVoid> logout();

    @ApiOperation(value = "获取当前登录的用户信息")
    @GetMapping("/getUserInfoByCurrentLogin")
    BaseResponse<UserInfoAResp> getUserInfoByCurrentLogin();

}
